/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.treinamento.collections.comparableComparator;

import java.util.Comparator;

/**
 *
 * @author felipe
 */
public class ItemValorComparator implements Comparator<Item> {

    @Override
    public int compare(Item itemA, Item itemB) {
        if (itemA.getValor() == itemB.getValor()){
            return 0;
        }else if(itemA.getValor() > itemB.getValor()){
            return -1;
        }else {
            return 1;
        }
    }
    
}
